import 'package:thinking/config/_.dart';
import 'package:thinking/entity/_.dart';
import 'package:thinking/http/Dio.dart';
import 'package:dio/dio.dart';
class TopicService {
  static Future<Tag?> topicContent(
      {Map<String, dynamic>? params}) async {
    var res = await HttpApi().get(
        url: Config.apiUrl['ApiList']['topicContent'],
        params: params,
        options: Options(extra: {'showLoading': false}));
    return Tag
        .fromJson(res['data']);
  }

  static Future<dynamic> changeSubTopic(
      {Map<String, dynamic>? params}) async {
    var res = await HttpApi().get(
        url: Config.apiUrl['ApiList']['changeSubTopic'],
        params: params,
        options: Options(extra: {'showLoading': true}));
    return res;
  }
  static Future<List<TagClassIndex>> getAllTagClass(
      {Map<String, dynamic>? params}) async {
    var res = await HttpApi().get(
        url: Config.apiUrl['ApiList']['getAllTagClass'],
        params: params,
        options: Options(extra: {'showLoading': false}));
    return TagClassIndexEntity.fromJson(res).data!.tagClassList!;
  }
  static Future<List<Tag>> getIndexAllTopic(
      {Map<String, dynamic>? params}) async {
    var res = await HttpApi().get(
        url: Config.apiUrl['ApiList']['getIndexAllTopic'],
        params: params,
        options: Options(extra: {'showLoading': false}));
    return TagClassEntity.fromJson(res).data!.tagList!;
  }

}




